#include<iostream>
#include"HashTable.h"
using namespace hash_bucket;
using namespace std;

void test_int()
{
	HashTable<int, int> t;
	t.Insert(make_pair(1, 1));
	t.Insert(make_pair(4, 1));
	t.Insert(make_pair(15, 1));
	t.Insert(make_pair(2, 1));
	t.Insert(make_pair(24, 1));
	t.Insert(make_pair(9, 1));
	t.Insert(make_pair(12, 1));
	t.Insert(make_pair(10, 1));
	cout << t.Empty() << " " << t.Size() << " " << t.Capacity() << endl;

	cout << t.Find(12) << " " << t.Find(10) << " " << t.Find(20) << endl;

	HashTable<int, int> t2;
	t2.Insert(make_pair(22, 1));
	t2.Insert(make_pair(44, 1));
	t2.Insert(make_pair(55, 1));

	t.Swap(t2);
	t.Erase(22);
	cout << t.Empty() << " " << t.Size() << " " << t.Capacity() << endl;
	t.Erase(55);
	cout << t.Empty() << " " << t.Size() << " " << t.Capacity() << endl;
	t.Clear();
	cout << t.Empty() << " " << t.Size() << " " << t.Capacity() << endl;

	t2.Clear();
}
void test_string()
{
	HashTable<string, int> t;
	t.Insert(make_pair("hh", 1));
	t.Insert(make_pair("hello", 1));
	t.Insert(make_pair("sort", 1));
	t.Insert(make_pair("reserve", 1));
	t.Insert(make_pair("country", 1));
	t.Insert(make_pair("reverse", 1));

	cout << t.Empty() << t.Size() << t.Capacity() << endl;
	cout << t.Find("sort") << " " << t.Find("hhh") << endl;

	cout << t.Erase("sort") << " ";
	cout<< t.Find("sort") << endl;
	t.Erase("hh");
	t.Erase("reserve");
	t.Erase("hello");
	cout << t.Size() << endl;

}

int main()
{
	test_string();

	return 0;
}